package top.csjss.hospital.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.transaction.annotation.Transactional;
import top.csjss.hospital.entity.SysRole;
import top.csjss.hospital.entity.SysRoleExample;

public interface SysRoleMapper {
    long countByExample(SysRoleExample example);

    int deleteByExample(SysRoleExample example);

    int deleteByPrimaryKey(Integer roleId);

    int insert(SysRole record);

    int insertSelective(SysRole record);

    List<SysRole> selectByExample(SysRoleExample example);

    SysRole selectByPrimaryKey(Integer roleId);

    int updateByExampleSelective(@Param("record") SysRole record, @Param("example") SysRoleExample example);

    int updateByExample(@Param("record") SysRole record, @Param("example") SysRoleExample example);

    int updateByPrimaryKeySelective(SysRole record);

    int updateByPrimaryKey(SysRole record);

    List<Integer> findMenuIdByRoleId(Integer roleid);

    /**
     * 根据roleid删除角色菜单
     *
     * @param roleid
     */
    void deleteRoleMenus(Integer roleid);

    /**
     * 保存角色菜单信息
     *
     * @param roleid
     * @param ids
     * @return
     */
    int saveRoleMenu(@Param("roleid") Integer roleid, @Param("ids") Integer[] ids);

}
